/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;

/**
 * CategoryResponse
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-12T19:05:39.971406+08:00[Asia/Shanghai]")
public class CategoryResponse {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private BigDecimal id;

  public static final String SERIALIZED_NAME_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  private String name;

  /**
   * If set to &#x60;true&#x60;, indicates this category can be targeted in a targeting expression. Otherwise, set to false.
   */
  @JsonAdapter(IsTargetableEnum.Adapter.class)
  public enum IsTargetableEnum {
    TRUE("true"),
    
    FALSE("false");

    private String value;

    IsTargetableEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static IsTargetableEnum fromValue(String value) {
      for (IsTargetableEnum b : IsTargetableEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<IsTargetableEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final IsTargetableEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public IsTargetableEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return IsTargetableEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_IS_TARGETABLE = "isTargetable";
  @SerializedName(SERIALIZED_NAME_IS_TARGETABLE)
  private IsTargetableEnum isTargetable;

  public static final String SERIALIZED_NAME_PATH = "path";
  @SerializedName(SERIALIZED_NAME_PATH)
  private String path;


  public CategoryResponse id(BigDecimal id) {
    
    this.id = id;
    return this;
  }

   /**
   * The category identifier.
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The category identifier.")

  public BigDecimal getId() {
    return id;
  }


  public void setId(BigDecimal id) {
    this.id = id;
  }


  public CategoryResponse name(String name) {
    
    this.name = name;
    return this;
  }

   /**
   * The category name.
   * @return name
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The category name.")

  public String getName() {
    return name;
  }


  public void setName(String name) {
    this.name = name;
  }


  public CategoryResponse isTargetable(IsTargetableEnum isTargetable) {
    
    this.isTargetable = isTargetable;
    return this;
  }

   /**
   * If set to &#x60;true&#x60;, indicates this category can be targeted in a targeting expression. Otherwise, set to false.
   * @return isTargetable
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "If set to `true`, indicates this category can be targeted in a targeting expression. Otherwise, set to false.")

  public IsTargetableEnum getIsTargetable() {
    return isTargetable;
  }


  public void setIsTargetable(IsTargetableEnum isTargetable) {
    this.isTargetable = isTargetable;
  }


  public CategoryResponse path(String path) {
    
    this.path = path;
    return this;
  }

   /**
   * The path of this category within the category catalog.
   * @return path
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The path of this category within the category catalog.")

  public String getPath() {
    return path;
  }


  public void setPath(String path) {
    this.path = path;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CategoryResponse categoryResponse = (CategoryResponse) o;
    return Objects.equals(this.id, categoryResponse.id) &&
        Objects.equals(this.name, categoryResponse.name) &&
        Objects.equals(this.isTargetable, categoryResponse.isTargetable) &&
        Objects.equals(this.path, categoryResponse.path);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, name, isTargetable, path);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CategoryResponse {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    isTargetable: ").append(toIndentedString(isTargetable)).append("\n");
    sb.append("    path: ").append(toIndentedString(path)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

